package com.cloudlead.customerAction.action;

import com.cloudlead.common.lang.annotation.Label;
import com.cloudlead.common.lang.persistence.Page;
import com.cloudlead.common.worker.action.impl.AbstractActionFactory;
import com.cloudlead.common.worker.annotation.Action;
import com.cloudlead.common.worker.annotation.Order;
import com.cloudlead.customerAction.BusinessModules;
import com.cloudlead.customerAction.service.ContainerInfoFindSer;
import com.cloudlead.customerService.ContainerInfoFindService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * Created by wyj on 2015/8/31.
 */
@Controller
public class ContainerInfoFindActionFactory extends AbstractActionFactory implements ContainerInfoFindService{
    public ContainerInfoFindActionFactory() {
        super(BusinessModules.ContainerInfoFind);
    }

    @Autowired
    ContainerInfoFindSer containerInfoFindSer;

    @Override
    @Action
    @Order(1)
    @Label("箱信息分页查询")
    public Page<Object> containerInfoFind(@NotNull @Label("订单ID")String customerOrderId,@Label("每页条数")int size,@Label("页码")int page) {
        return containerInfoFindSer.containerInfoFind(customerOrderId,size,page);
    }

    @Override
    @Action
    @Order(2)
    @Label("箱信息列表查询")
    public List<Object> containerInfoFindAll(@NotNull @Label("订单ID")String customerOrderId) {
        return containerInfoFindSer.containerInfoFindAll(customerOrderId) ;
    }

    @Override
    @Action
    @Order(3)
    @Label("箱信息单值查询")
    public Object containerInfoFindOne(@NotNull @Label("ID")String id) {
        return containerInfoFindSer.containerInfoFindOne(id);
    }
}
